package com.tom.config.aop;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

@Aspect
@Component
public class LogAspect {

	@Pointcut("within(com.tom.controller..*)")
	public void pointCut() {
	}

	/**
	 * 前置通知 用于拦截操作，在方法返回后执行
	 * @param joinPoint 切点
	 */
	@Before("pointCut()")
	public void doBefore(JoinPoint joinPoint) {
		System.out.println(">>>>>>>>>>>>>>>>>>>@Before:doBefore");
	}

	/**
	 * @param joinPoint
	 * @param e
	 */
	@After(value = "pointCut()")
	public void doAfter(JoinPoint joinPoint) {
		System.out.println(">>>>>>>>>>>>>>>>>>>@After:doAfter");
	}

}